package net.wangds.config.repository.db;

import net.wangds.jpa.repository.RemovableRepo;
import net.wangds.config.module.Config;
import net.wangds.data.RemovedEnum;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface SysConfigRepo extends RemovableRepo<Config> {

    Optional<Config> findByCataAndItem(String cata, String key);

    Optional<Config> findByCataAndItemAndRemoved(String cata, String key, RemovedEnum removed);


    List<Config> findByCataAndRemoved(String cata, RemovedEnum removed, Sort sort);

    Page<Config> findByCataAndRemoved(String cata, RemovedEnum removed, Pageable page);

    Page<Config> findByCataLikeAndRemoved(String cata, RemovedEnum removed, Pageable page);

}
